package com.linpq.road.service;

import java.util.List;
import com.linpq.common.core.service.CrudService;
        import com.linpq.common.utils.DateUtils;
            import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linpq.road.mapper.RdPavementDamageMapper;
import com.linpq.road.domain.RdPavementDamage;
import com.linpq.common.core.text.Convert;
import com.linpq.common.core.service.BaseService;
/**
 * 路面破损Service业务层处理
 *
 * @author linpq
 * @date 2021-07-29
 */
@Service
public class RdPavementDamageService  extends CrudService<RdPavementDamageMapper, RdPavementDamage> {

    /**
     * 查询路面破损
     *
     * @param id 路面破损ID
     * @return 路面破损
     */

    public RdPavementDamage selectRdPavementDamageById(String id) {
        return dao.get(id);
    }

    /**
     * 查询路面破损列表
     *
     * @param rdPavementDamage 路面破损
     * @return 路面破损
     */

    public List<RdPavementDamage> selectRdPavementDamageList(RdPavementDamage rdPavementDamage) {
        return dao.findList(rdPavementDamage);
    }

    /**
     * 新增路面破损
     *
     * @param rdPavementDamage 路面破损
     * @return 结果
     */

    public int insertRdPavementDamage(RdPavementDamage rdPavementDamage) {
        rdPavementDamage.setCreateTime(DateUtils.getNowDate());
        return super.save(rdPavementDamage);
    }

    /**
     * 修改路面破损
     *
     * @param rdPavementDamage 路面破损
     * @return 结果
     */

    public int updateRdPavementDamage(RdPavementDamage rdPavementDamage) {
                rdPavementDamage.setUpdateTime(DateUtils.getNowDate());
        return super.save(rdPavementDamage);
    }

    /**
     * 删除路面破损对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */

    public int deleteRdPavementDamageByIds(String ids) {
        return dao.deleteRdPavementDamageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除路面破损信息
     *
     * @param id 路面破损ID
     * @return 结果
     */
    public int deleteRdPavementDamageById(String id) {
        return dao.delete(id);
    }
}
